<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Quyen_model extends CI_Model {

	function __construct()
	{
		parent::__construct();
		$this->load->helper("url");
		$this->load->database();
	}
	function listQuyen(){
		/* $this->db->select('*');
		$this->db->from('vtv4_quyen A');
		$this->db-> */
	}
	function addQuyen($data){
		return $this->db->insert('vtv4_quyen',$data);
	}
	function getQuyen($id_quyen){
		$this->db->where('id_quyen',$id_quyen);
		$query = $this->db->get('vtv4_quyen');
		return $query->row();
	}
	function editQuyen($data,$id_quyen){
		$this->db->where('id_quyen',$id_quyen);
		return $this->db->update('vtv4_quyen',$data);
	}
	function delQuyen($id_quyen){
		$this->db->where('id_quyen',$id_quyen);
		return $this->db->delete('vtv4_quyen');
	}
}